<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<head>
  <meta charset="UTF-8">
  <title>v-bind</title>
  <style>
    .active {
      border: 10px solid red;
    }
  </style>
</head>
<div id="app">
  <img v-bind:src="img">
  <img :src="img" :title="imgTitle" :class="{active:isActive}" @click="SuisActive">
</div>
<body>
<script>
  var app = new Vue({
    el: "#app",
    data: {
      img: "icon.png",
      imgTitle: "黑马程序员",
      isActive:false
    },
    methods:{
      SuisActive:function (){
        this.isActive=!this.isActive;
      }
    }
  })
</script>
</body>
</html>
